<template>
  <div>
    <FormPanel ref="from" :list="formList" @formChange="changeHandle" :isSubmitBtn="false" :collapse="false" labelWidth="110" />
  </div>
</template>
<script>
import { getflowList, getDealerUser } from '@/api/index.js';
import { dictionary } from '@/utils/dictMixin';
import moment from 'moment';
export default {
  data() {
    this.saveData = null;
    return {
      formList: this.createdFrom(),
    };
  },
  components: {},
  props: ['rowData'],
  created() {
    this.init(this.rowData);
  },
  mixins: [dictionary],
  methods: {
    init(data) {
      for (let i in data) {
        this.formList.map((x) => {
          if (x.fieldName == i) {
            x.initialValue = data[i];
          }
        });
      }
    },
    createdFrom() {
      return [
        {
          type: 'BREAK_SPACE',
          label: '订单信息',
        },
        {
          type: 'INPUT',
          label: '货运单号',
          fieldName: 'shipmentOrderNo',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: 'SAP销售单号',
          fieldName: 'sapNo',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: 'DMS批售订单号',
          fieldName: 'orderNo',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '订单管理号',
          fieldName: 'doNo',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: 'VIN',
          fieldName: 'vin',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '经销商代码',
          fieldName: 'dealerCode',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '经销商名称',
          fieldName: 'dealerName',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'SELECT',
          label: '运输方式',
          fieldName: 'transportType',
          placeholder: '请选择',
          disabled: true,
          itemList: this.createDictList('2409'),
        },
        {
          type: 'SELECT',
          label: '收车地址',
          fieldName: 'address',
          placeholder: '请选择',
          disabled: true,
          itemList: [],
        },
        {
          type: 'SELECT',
          label: '送达城市',
          fieldName: 'cityId',
          placeholder: '请选择',
          disabled: true,
          itemList: [],
        },
        {
          type: 'INPUT',
          label: '联系人',
          fieldName: 'linkMan',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '联系电话',
          fieldName: 'linkPhone',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '承运单位',
          fieldName: 'carrierCompany',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '发车人',
          fieldName: 'departurePerson',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '承运人',
          fieldName: 'carrierPerson',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '承运时间',
          fieldName: 'carrierDate',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '承运司机',
          fieldName: 'carrierDriver',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '司机联系方式',
          fieldName: 'carrierDriverPhone',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '收车人',
          fieldName: 'receiver',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '物料编码',
          fieldName: 'productCode',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '物料描述',
          fieldName: 'productName',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '车型',
          fieldName: 'modelName',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '配置',
          fieldName: 'configName',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '选装',
          fieldName: 'optionName',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '内饰',
          fieldName: 'trimName',
          placeholder: '请输入',
          disabled: true,
        },
        {
          type: 'INPUT',
          label: '外饰',
          fieldName: 'colorName',
          placeholder: '请输入',
          disabled: true,
        },
      ];
    },
    changeHandle(val) {
      this.saveData = val;
    },
    async closeDrawer(type) {
      if (type == 1) {
        this.$emit('close');
      }
    },
  },
};
</script>
